<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <title>非本地户籍区域选择</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../static/css/style.css" media="all">
    <script type="text/javascript" src="../../static/js/jquery.min.js"></script>
    <script type="text/javascript" src="../../layui/layui.all.js" charset="utf-8"></script>
    <script type="text/javascript" src="../../static/js/jquery.cookie.js"></script>
    <script type="text/javascript" src="../../static/js/base.js" charset="utf-8"></script>
    <script type="text/javascript" src="../../static/js/ax.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="../../static/js/html5.js"></script>
    <script src="../../static/js/respond.js"></script>
    <![endif]-->
</head>

<body class="bg_w">

    <div class="layui-fluid">
        <div class="content-wrap">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-sm6">
                    <label class="layui-form-label">区域名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="code" id="code" autocomplete="off" class="layui-input">
                    </div>
                </div>
              
                <div class="layui-col-xs4">
                    <button class="layui-btn add_btn" data-type="reload" onclick="searchBtn()">
                        <i class="layui-icon layui-icon-search"></i>搜索</button>
                </div>
            </div>
            <div class="layui-row">
                <table class="layui-hide" id="position" lay-filter="eventBtn"></table>
                <input type="hidden" name="positionId" id="positionId">
                <input type="hidden" name="positionName" id="positionName">
            </div>
        </div>
    </div>

    <script>


        var tableIns;
        var departmentCode;
        $(document).ready(function () {
            layui.use(['table', 'layer', 'element'], function () {
                var table = layui.table;
                tableIns = ax.VTable({
                    elem: "#position",
                    //id:"positionTable",
                    url: schoolWebUrl + "/api/position/list",
                    method: 'POST',
                    cols: [[
                        { field: '序列号', width: 80, title: '序列号', sort: true, type: 'numbers' },
                        { field: 'name', title: '区域编码' },
                        { field: 'code', title: '区域名称' },
                    ]]
                });

                //监听行单击事件（单击事件为：rowDouble）
                table.on('row(eventBtn)', function (obj) {
                    var postionJson = obj.data;
                    console.log(postionJson)
                    //标注选中样式
                    obj.tr.addClass('layui-table-click').siblings().removeClass('layui-table-click');
                    parent.document.getElementById("layerResult").value = "非本地";

                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                    parent.layer.close(index); //再执行关闭

                });

            });
        });

    </script>
</body>

</html>